#ifndef InputManager_h
#define InputManager_h

#include <vector>
#include "../Input/InputConfiguration.h"
#include "../Input/InputAction.h"
#include "../Input/Keyboard.h"
#include "../Input/InputEntry.h"
#include "../Utility/Singleton.h"

using namespace std;

struct tActionMapping {
	int miAction;
	int miDevice;
	int miChannel;
};

enum devices {
	eKeyboard = 0
};
/*
	Class Input Manager
*/
class cInputManager : public cSingleton<cInputManager> {
	friend class cSingleton<cInputManager>;
private:
	vector< vector< cInputEntry>> mMapped;
	vector< cInputAction> mActions;
	vector< cGenericDevice *> mDevices;
	// Check the channel of a device
	float Check(int liDevice, int liChannel);
public:
	// Initialize the Input Manager
	void Init(const tActionMapping laActionMapping[], unsigned luiActionCount);
	// Update the Input Manager
	void Update(const float &lfTimeStep);
	// Get an action
	inline cInputAction &GetAction(const int &liActionId) {return mActions[liActionId];}
	// Deinitialize the Input Manager
	void DeInit();
};
#endif